const connection = require("../db/sql");
const {delay} = require("../utils/delay");

/**
 * 删除数据库数据
 * @param sql sql语句
 * @returns {Promise<boolean>} 返回成功与否
 */
async function deleteData(sql) {
    let isErr = false
    // let result = [];
    await connection.query(sql, function (err, res) {
        if (err) {
            isErr = true
            // console.log(err)
            throw err
        } else {
            // result = [].concat(res, [])
        }
    })
    await delay(800)
    return isErr
}
module.exports = deleteData
